package bstsetcode;

/**
 * @author noob
 * @version 1.0
 * @date 2021/3/14 9:15
 */
public class ArrayTest {

    public static void main(String[] args) {
        Array array = new Array(20);
        for (int i = 0; i < 10; i++) {
            array.addLast(i);
        }

        System.out.println(array.toString());

        array.add(1,33);
        System.out.println(array.toString());

        array.addFirst(-1);
        System.out.println(array.toString());

        System.out.println(array.getElementByIndex(0));

        array.setElement(0,100);
        System.out.println(array.toString());


        boolean contains = array.contains(100);
        System.out.println("数组是否包含100:"+ contains);


        array.remove(0);
        System.out.println(array.toString());

        int first = array.removeFirst();
        System.out.println(first);
        System.out.println(array.toString());


        array.removeLast();
        System.out.println(array.toString());

        array.removeElement(5);
        System.out.println(array.toString());
    }
}

